﻿<!DOCTYPE html>
<html>
<head>
   <title>Logging CSV files with VI-DriveSim on Linux</title>
   <meta name="generator" content="Help & Manual">
   <meta name="keywords" content="">
   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
   <link type="text/css" href="default.css" rel="stylesheet">
   <link type="text/css" href="custom.css" rel="stylesheet">
   <script type="text/javascript" src="nsh.js"></script>
   
<!-- non-scrolling headers for CHM and browser-based help, local styles-->
<style TYPE="text/css" media="screen"> 
   <!-- 
   body {    
      margin:0; 
      padding:0; 
      overflow: auto; 
      background: #edede9; 
   } 
   #idheader { 
      width:100%; 
      height:auto; 
      padding: 0; 
      margin: 0;     
} 
    #idheaderbg  {
    background: #E40A00; 
}
#idheadernowrap  {
    white-space:nowrap; 
}
    ul {list-style-type: lower-roman}
   -->
   </style>
   
<style TYPE="text/css" MEDIA="print">
<!--
/* Hide navigation links and add space between header
     and text in the printed version. Not valid for eBooks. */
#idnav { display:none;	 }
.topichead { padding: 5px 5px 20px 5px; }
-->
</style>   
   <script type="text/javascript" src="jquery.js"></script>
   <script type="text/javascript" src="helpman_settings.js"></script>
   <script type="text/javascript" src="helpman_topicinit.js"></script>

   <script type="text/javascript">
     HMSyncTOC("index.html", "drvsim_inst_logging-csv-files-with-prod_na.htm");
   </script>
   <script type="text/javascript" src="highlight.js"></script>
   <script type="text/javascript">
     $(document).ready(function(){highlight();});
   </script>
</head>
<body>

<!--ZOOMSTOP-->

<div id="idheader" >
<div id="idheaderbg">
<table width="100%" border="0" cellspacing="0" cellpadding="0" 
       style="margin: 0px; color: #D7D7D7;">

  <tr valign="middle">
    <td align="left" valign="middle" class="topichead">
    <!--<div id="idheadernowrap">-->
    <p class="crumbs" id="idnav"><b>Navigation:</b>&nbsp;
   
   VI-DriveSim 19.2 on Linux &gt; <a href="drivesim_tut_tutorials.htm">VI-DriveSim 19.2 Tutorials</a> &gt; Performing a simulation with VI-DriveSim&nbsp;&gt;</p>
      <h1 class="p_Heading1" style="page-break-after: avoid;"><span class="f_Heading1">Logging CSV files with VI-DriveSim on Linux</span></h1>

    <!--</div>-->
    </td>
    <td align="right" width="180" valign="middle" class="topichead" id="idnav">
    <div id="idheadernowrap">
    <a href="javascript: print();"
    		onmouseover="document.images.prntr.src='print_a.png'" 
        onmouseout="document.images.prntr.src='print_n.png'"
        ><img name="prntr" border="0" alt="Print this Topic" title="Print this Topic" src="print_n.png"
        ></a>&nbsp;&nbsp;
     <a href="vbk_tut_performing_a_simulation_with_v.htm"
        onmouseover="document.images.prev.src='back_a.png'" 
        onmouseout="document.images.prev.src='back_n.png'"
        ><img name=prev src="back_n.png" border=0 alt="Previous page"
        ></a><a href="drivesim_tut_tutorials.htm"
        onmouseover="document.images.main.src='top_a.png'" 
        onmouseout="document.images.main.src='top_n.png'"><img name=main src="top_n.png" border=0 alt="Return to chapter overview"
        ></a><a href="drvsim_inst_streaming-live-telemetry-to-wi.htm"
        onmouseover="document.images.next.src='next_a.png'" 
        onmouseout="document.images.next.src='next_n.png'"><img name=next src="next_n.png" border=0 alt="Next page"
        ></a>
    </div>
    </td>
  </tr>
</table>
</div>

<!-- The following code displays Expand All/Collapse All links  below the header in topics containing toggles -->
  

</div>  



<div id="idcontent"><div id="innerdiv"> 
<!--ZOOMRESTART-->
<p class="p_Normal">In VI-DriveSim it is possible both to log (and save) a csv file with the data coming from the driving session or to stream the data to a 3rd party live telemetry software (Magneti Marelli WinTAX - a proper license is required).</p>
<p class="p_Normal">&nbsp;</p>
<p class="p_Normal">To do so, the following steps need to be done.</p>
<p class="p_Normal">&nbsp;</p>
<p class="p_Normal">In SimulationWorkBench, a proper test has to be set up; in particular, the iodb_csv needs to be added to the test (to see the necessary executables needed in a standard test for the driving simulator, please look at <a href="drvsim_inst_creating-a-test-with-simwb.htm" class="topiclink">Creating a Test with SimWB</a>).</p>
<p class="p_Normal">&nbsp;</p>
<p class="p_Normal" style="text-align: center;"><img alt="drvsim_create_Test_03_csv" width="960" height="540" style="margin:0px auto 0px auto;width:960px;height:540px;border:none" src="drvsim_create_test_03_csv.png"/></p>
<p class="p_Normal" style="text-align: center;">&nbsp;</p>
<p class="p_Normal"><span style="font-weight: bold;">NOTE. </span>The streaming to WinTAX can only run at 100 Hz, so it is mandatory to set the Freq Divider to 10. Since the TimeStep is 0.001s, Freq Divider = 10 means that the iodb_csv will run at 100 Hz. If the iodb_csv is added just to log a csv file (so no streaming) it is possible to log also at 1000 Hz (Freq Divider = 1).</p>
<p class="p_Normal">&nbsp;</p>
<p class="p_Normal">Now that the test is done, it is possible to proceed with the creation of a Test Session, as explained in the <a href="drvsim_inst_creating-a-test-session-with-s.htm" class="topiclink">relative chapter</a>.</p>
<p class="p_Normal">&nbsp;</p>
<p class="p_Normal">Once that also the Test Session is done, it is necessary to setup the iodb_csv configuration on VI-DriveSim.</p>
<p class="p_Normal">&nbsp;</p>
<p class="p_Normal" style="text-align: center; margin: 0px 0px 0px 24px;"><img alt="drvsim_iodb_csv_tab" width="634" height="611" style="margin:0px auto 0px auto;width:634px;height:611px;border:none" src="drvsim_iodb_csv_tab.png"/></p>
<p class="p_Normal" style="text-align: center; margin: 0px 0px 0px 24px;">&nbsp;</p>
<p class="p_Normal">In configuration/iodb_csv it is possible to set these parameters:</p>
<p class="p_Normal">&nbsp;</p>
<p style="text-align: justify; text-indent: 0px; padding: 0px 0px 0px 13px; margin: 0px 0px 0px 0px;"><span style="font-size:10pt; font-family: 'Arial Unicode MS','Lucida Sans Unicode','Arial';color:#000000;display:inline-block;width:13px;margin-left:-13px">&#8226;</span><span style="font-weight: bold;">VIDRIVESIM_CSV_PREFIX</span> --&gt; Prefix for folders conteining CSV session files, saved in vigrade/vicrt/csv/; used only if VIDRIVESIM_CSV_LOG_MODE = 1</p><p style="text-align: justify; text-indent: 0px; padding: 0px 0px 0px 13px; margin: 0px 0px 0px 0px;"><span style="font-size:10pt; font-family: 'Arial Unicode MS','Lucida Sans Unicode','Arial';color:#000000;display:inline-block;width:13px;margin-left:-13px">&#8226;</span><span style="font-weight: bold;">VIDRIVESIM_CSV_CUSTOM_FILE</span> --&gt; File that contains extra SimWB RTDB items to log, full path must be provided; an example of a CSV_custom_signals.sig.distrib is provided in <span style="font-style: italic;">vigrade/vicrt/standalone/</span>; to create a custom signals file, see below. </p><p style="text-align: justify; text-indent: 0px; padding: 0px 0px 0px 13px; margin: 0px 0px 0px 0px;"><span style="font-size:10pt; font-family: 'Arial Unicode MS','Lucida Sans Unicode','Arial';color:#000000;display:inline-block;width:13px;margin-left:-13px">&#8226;</span><span style="font-weight: bold;">VIDRIVESIM_CSV_BUFFER_FRAMES</span> --&gt; Number of frames data to buffer before writing to disc; used only if VIDRIVESIM_CSV_LOG_MODE = 1</p><p style="text-align: justify; text-indent: 0px; padding: 0px 0px 0px 13px; margin: 0px 0px 0px 0px;"><span style="font-size:10pt; font-family: 'Arial Unicode MS','Lucida Sans Unicode','Arial';color:#000000;display:inline-block;width:13px;margin-left:-13px">&#8226;</span><span style="font-weight: bold;">VIDRIVESIM_CSV_USE_OUT_MAP</span> --&gt; 0 - manage the channels to log using the CSV Save window</p><p style="text-align: justify; text-indent: 0px; padding: 0px 0px 0px 13px; margin: 0px 0px 0px 0px;"><span style="font-size:10pt; font-family: 'Arial Unicode MS','Lucida Sans Unicode','Arial';color:#000000;display:inline-block;width:13px;margin-left:-13px">&#8226;</span><span style="font-weight: bold;">VIDRIVESIM_CSV_DEST_STREAM</span> --&gt; Endpoint to stream data to, IP:PORT, i.e 192.168.101.40:41666; used only when VIDRIVESIM_CSV_LOG_MODE = 2</p><p style="text-align: justify; text-indent: 0px; padding: 0px 0px 0px 13px; margin: 0px 0px 0px 0px;"><span style="font-size:10pt; font-family: 'Arial Unicode MS','Lucida Sans Unicode','Arial';color:#000000;display:inline-block;width:13px;margin-left:-13px">&#8226;</span><span style="font-weight: bold;">VIDRIVESIM_CSV_LOG_MODE</span> --&gt; 0 - log CSV &amp; stream, 1 - save a CSV in vigrade/vicrt/csv/FOLDER_PREFIX_NAME, 2 - stream data to a different machine (for live telemetry)</p><p style="text-align: justify; text-indent: 0px; padding: 0px 0px 0px 13px; margin: 0px 0px 0px 0px;"><span style="font-size:10pt; font-family: 'Arial Unicode MS','Lucida Sans Unicode','Arial';color:#000000;display:inline-block;width:13px;margin-left:-13px">&#8226;</span><span style="font-weight: bold;">VIDRIVESIM_DISKWRITER_CPU</span> --&gt; alternative CPU to be used by the logger thread</p><p style="text-align: justify; text-indent: 0px; padding: 0px 0px 0px 13px; margin: 0px 0px 0px 0px;"><span style="font-size:10pt; font-family: 'Arial Unicode MS','Lucida Sans Unicode','Arial';color:#000000;display:inline-block;width:13px;margin-left:-13px">&#8226;</span><span style="font-weight: bold;">VIDRVESIM_CSV_CIRCULAR_BUFFER</span> --&gt; number of seconds to hold in the storage buffer</p><p class="p_Normal">&nbsp;</p>
<p class="p_Normal">After the iodb_csv is configured, it is necessary to enable the CSV writing; to do that, in VI-DriveSim Initial Value - VI-DriveSim Signals/VI_DriveSim/Inputs/Controls/CSVWRITE_FLAG must be set to 1.</p>
<p class="p_Normal">&nbsp;</p>
<p class="p_Normal">To manage the channels that need to be saved, it is possible to activate/deactivate them using the CSV Save window, in VI-DriveSim Configuration tab.</p>
<p class="p_Normal">&nbsp;</p>
<p class="p_Normal"><span style="font-size: 12pt; font-weight: bold;">Creating a custom_signals.sig</span></p>
<p class="p_Normal">To create a custom_signals.sig file, click on <span style="font-style: italic;">RTDB Tools</span> on VI-DriveSim, <span style="font-style: italic;">Configuration </span>tab; for the RTDB used in test, click on <span style="font-style: italic;">csv log. </span>Now all the available custom signals are shown in the window, select the needed ones and then press save. It is possible now to set the name of the new custom_signals file and where to save it; <span style="text-decoration: underline;">when typing the name, also the extension </span><span style="font-style: italic; text-decoration: underline;">.sig </span><span style="text-decoration: underline;">at the end must be written, otherwise the file will not work</span>.</p>
<p class="p_Normal">&nbsp;</p>
<p class="p_Normal">The custom signals shown in the window are the one available for the selected RTDB, and usually the custom signals needed for the logging come from an external Simulink model; therefore, the Simulink model must be compiled before creating the custom signals. This way, when appending the RTDB from the MLToolkit and after compiling the model, the new added channels will be shown in the <span style="font-style: italic;">csv log</span> window.</p>
<p class="p_Normal">&nbsp;</p>
<p class="p_Normal" style="text-align: center;"><img alt="drvsim_custom_sig" width="634" height="475" style="margin:0px auto 0px auto;width:634px;height:475px;border:none" src="drvsim_custom_sig.png"/></p>

<!--ZOOMSTOP-->
</div></div>
<script type="text/javascript"> 
<!-- 
var lastSlashPos = document.URL.lastIndexOf("/") >
document.URL.lastIndexOf("\\") ? document.URL.lastIndexOf("/") :
document.URL.lastIndexOf("\\");
if( document.URL.substring( lastSlashPos + 1, lastSlashPos + 4
).toLowerCase() != "~hh" )
{
    nsrInit();
}
--> 
</script> 
</body>
</html>
